package cn.com.yuuuu.controller;


import cn.com.yuuuu.config.MyMessageSource;
import cn.com.yuuuu.domain.model.CommonResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/a")
@RequiredArgsConstructor
public class TestController {


    private final MyMessageSource myMessageSource;



    @PostMapping("/b")
    public String b() {

        return myMessageSource.getSourceFromCache("code", null);
    }

    @GetMapping("/c")
    public CommonResult<String> c(@RequestParam String code) {

        return new CommonResult<>(code,myMessageSource);
    }


}
